
Public Class DAONHANVIEN
    Public Shared Function NhanVien_Load() As DataTable
        Return DataProvider.LoadTable("select * from nhanvien")
    End Function

    Public Shared Sub NhanVien_Insert(ByVal n As DTONhanVien)
        Dim sql As String = String.Format("insert into NhanVien(Tennv,NgaySinh,DiaChi,DienThoai,gioitinh,macv) values (N'{0}','{1}','{2}','{3}',N'{4}','{5}')", n.TenNV, n.NgaySinh, n.DiaChi, n.DienThoai, n.GioiTinh, n.MaCV)
        DataProvider.ExecuteNonQuery(sql)
    End Sub

    Public Shared Sub NhanVien_Update(ByVal n As DTONhanVien)
        Dim sql As String = String.Format("update NhanVien set tennv = N'{0}', NgaySinh = '{1}', DiaChi = N'{2}', DienThoai = '{3}', macv = '{4}' where Manv = '{5}'", _
                                         n.TenNV, n.NgaySinh, n.DiaChi, n.DienThoai, n.MaCV, n.MaNV)
        DataProvider.ExecuteNonQuery(sql)
    End Sub
    Public Shared Sub NhanVien_Delete(ByVal n As DTONhanVien)
        Dim sql As String = String.Format("delete NhanVien where MAnv = '{0}'", n.MaNV)
        DataProvider.ExecuteNonQuery(sql)
    End Sub

End Class